﻿namespace Dissemination.MVC.Models
{
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Web.Mvc;

    [MetadataType(typeof(TargetAreaMetaData))]
    public partial class TargetArea
    {
        [DisplayName("Code")]
        public string TargetAreaCode
        {
            get
            {
                return this.Country.CountryCode + this.TargetAreaOrdinal;
            }
        }

        [Bind(Exclude = "TargetAreaID")]
        public class TargetAreaMetaData
        {
            [Required(ErrorMessage = "The center is required")]
            [StringLength(256)]
            [DisplayName("Center")]
            public string TargetAreaCenter { get; set; }

            [DisplayName("Country")]
            public Country Country { get; set; }

        }
    }
}